package cn.clq.basic.util;

import lombok.Data;

/**
 * @author clqlongbao
 * @version 1.0
 * @description: 用于事务操作返回操作结果
 * @date 2022/6/5 10:37
 */
@Data
public class AjaxResult {
    private Boolean success=true;
    private String message="操作成功";
    //用于返回操作的额外参数
    private Object resultObj;

    //用于链式编程，每次操作都返回当前对象的实例
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }


    /**
     * @description: 可以获取AjaxResult对象
     * @param:
     * @return: cn.clq.basic.util.AjaxResult
     * @author clqlongbao
     * @date: 2022/6/5 10:59
     */
    public static AjaxResult me(){
        return new AjaxResult();
    }
}
